package cs1;

import java.util.ArrayList;

public class SingerTest {
    public static void main(String[] args) {
        //分别实例化四个Singer对象
        Singer s1 = new Singer("郭富城",55,"踢足球");
        Singer s2 = new Singer("张学友",35,"游泳");
        Singer s3 = new Singer("刘德华",25,"打篮球");
        Singer s4 = new Singer("黎明",18,"击剑");
        //创建集合ArrayList
        ArrayList<Singer> list = new ArrayList<>();
        //add是往集合里面添加对象
        list.add(s1);//因为是用的满参数一次性赋值，把参数赋值到s1.s2.s3.s4上面了
        list.add(s2);
        list.add(s3);
        list.add(s4);
    }
}
